package org.example.myleet.p814;

import org.example.myleet.Utils.Assert;
import org.example.myleet.Utils.Parser;

public class Main {
    public static void main(String[] args) {
        Solution solution = new Solution();
        Assert.isTrue("[0,null,0,1,1,null,1,null,1]".equals(solution.pruneTree(Parser.parse(new Integer[]{0,null,0,1,1,null,1,null,1,null,null,null,null})).serialize()));
        Assert.isTrue("[1,null,0,null,1]".equals(solution.pruneTree(Parser.parse(new Integer[]{1,null,0,0,1})).serialize()));
        Assert.isTrue("[1,null,1,null,1]".equals(solution.pruneTree(Parser.parse(new Integer[]{1,0,1,0,0,0,1})).serialize()));
        Assert.isTrue("[1,1,0,1,1,null,1]".equals(solution.pruneTree(Parser.parse(new Integer[]{1,1,0,1,1,0,1,0})).serialize()));
        Assert.isTrue(null == solution.pruneTree(Parser.parse(new Integer[]{0})));
    }
}
